import Vue from 'vue'
import App from '@/App'
import router from '@/router'
import store from '@/store'
import VueCookie from 'vue-cookie'
import '@/element-ui'
import '@/icons'
import '@/element-ui-theme'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest'
import comReq from '@/utils/commonReq'
import {isAuth} from '@/utils'
// import reloadRoute from '@/utils/index'
import cloneDeep from 'lodash/cloneDeep'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import './icons/home/iconfont.css'
import './icons/hotel/iconfont.css'
import './icons/vip/iconfont.css'
import TableFilter from '@/components/table-filter'
import TopHeader from '@/components/top-header'
import ImgView from '@/components/img-view'
import VueAMap from 'vue-amap';
import i18n from './language/i18n'
import axios from 'axios'
import { ResizeObserver } from 'vue-resize';
Vue.directive('resize', ResizeObserver);

Vue.prototype.axios = axios
Vue.use(VueAMap)
Vue.use(VueCookie)
Vue.use(VueQuillEditor)
Vue.config.productionTip = false
Vue.component('TableFilter', TableFilter)
Vue.component('TopHeader', TopHeader)
Vue.component('ImgView', ImgView)
// import { HappyScroll } from 'vue-happy-scroll'
//自定义组件名
// Vue.component('happy-scroll', HappyScroll)
// // 引入css
// import 'vue-happy-scroll/docs/happy-scroll.css'

// import GeminiScrollbar from 'vue-gemini-scrollbar'

// Vue.use(GeminiScrollbar)
// 非生产环境, 适配mockjs模拟数据                 // api: https://github.com/nuysoft/Mock
if (process.env.NODE_ENV !== 'production') {
  require('@/mock')
}

// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法

Vue.prototype.isAuth = isAuth     // 权限方法

Vue.prototype.$comReq = comReq     // 公共请求方法

// Vue.prototype.$reloadRoute =router.reloadRoute    // 重载路由

/* 挂载选择酒店 1*/
import selectSeller from './views/modules/common/selectSeller.vue';
Vue.component('selectSeller', selectSeller)

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

VueAMap.initAMapApiLoader({
  key: '3bc57a7188e51c379cd5255bd5073fbc',
  plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'ToolBar', 'MapType', 'PolyEditor', 'AMap.CircleEditor', 'AMap.Geolocation']
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  template: '<App/>',
  components: {App}
})
